package order.controller;

import order.feign.stockFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
@CrossOrigin
public class orderController {
    @Value("${server.port}")
    String port;

    @Autowired
    stockFeignService stockFeignService;

    @RequestMapping("/buy")
    public String buy(){
        String msg = stockFeignService.add();
        return "buy in " + port + msg;
    }
}
